load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rangefeed",
    srcs = [
        "budget.go",
        "buffered_registration.go",
        "catchup_scan.go",
        "event_size.go",
        "filter.go",
        "metrics.go",
        "processor.go",
        "registry.go",
        "resolved_timestamp.go",
        "scheduled_processor.go",
        "scheduler.go",
        "stream.go",
        "stream_muxer.go",
        "stream_muxer_test_helper.go",
        "task.go",
        "test_helpers.go",
        "testutil.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rangefeed",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/sem/tree",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/util/admission",
        "//pkg/util/bufalloc",
        "//pkg/util/buildutil",
        "//pkg/util/container/heap",
        "//pkg/util/encoding",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/interval",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/retry",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "rangefeed_test",
    size = "large",
    srcs = [
        "bench_test.go",
        "budget_test.go",
        "catchup_scan_bench_test.go",
        "catchup_scan_test.go",
        "event_size_test.go",
        "processor_test.go",
        "registry_test.go",
        "resolved_timestamp_test.go",
        "scheduler_test.go",
        "stream_muxer_test.go",
        "task_test.go",
    ],
    embed = [":rangefeed"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/testutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/storageutils",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
